package com.diankangwo.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 *  读取配置文件
 * @author xiaoyu
 *
 */
public class LoadPropertyUtil {

	public static Properties loadProperty(String config) {
		InputStream inputStream = null;
		Properties prop = new Properties();
			try {
				inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(config);
				prop.load(inputStream);
			} catch(Exception e) {
				e.printStackTrace();
			} finally {
				if (inputStream != null)
					try {
						inputStream.close();
					} catch (IOException ex) {
						ex.printStackTrace();
					}
			}
			return prop;
		}
	
}
